package com.cskaoyan._05finalize;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/14 16:50
 **/

public class Demo {
    public static void main(String[] args) {
        // 匿名对象,理论上很快成为垃圾对象
        new Student();
        // 通知GC进行垃圾回收
        System.gc();
    }
}
class Student{
    @Override
    protected void finalize() throws Throwable {
        System.out.println("模拟释放资源");
    }
}